package com.imti.mall.product.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.imti.mall.model.cms.pojo.CmsSubject;
import com.imti.mall.model.cms.vo.CmsSubjectVo;
import com.imti.mall.product.dao.CmsSubjectDao;
import com.imti.mall.product.service.CmsSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CmsSubjectServiceImpl extends ServiceImpl<CmsSubjectDao, CmsSubject> implements CmsSubjectService {
    @Autowired
    CmsSubjectDao cmsSubjectDao;
    @Override
    public List<CmsSubject> findCmsSubject() {
        return cmsSubjectDao.selectList(null);
    }

    @Override
    public List<CmsSubject> findCmsSubjectByKeyword(CmsSubjectVo cmsSubjectVo,  Integer pageSize, Integer pageNum) {
        PageHelper.startPage(pageNum, pageSize);
        return cmsSubjectDao.findCmsSubjectByKeyword(cmsSubjectVo);
    }

    @Override
    public CmsSubject getCmsSubject(Long id) {
        return getById(id);
    }
}
